package IO;

import java.io.File;
import java.io.IOException;

public class IODemo1 {
    public static void main(String[] args) throws IOException {
        //绝对路径
        File f =new File("C:/Users/86135/Desktop/IO_Test/test.txt");

        //相对路径
        //File f =new File("./test.txt");

        //文件是否存在
        System.out.println(f.exists());
        //获取父路径
        System.out.println(f.getParent());
        //获取文件名
        System.out.println(f.getName());
        //获取路径
        System.out.println(f.getPath());
        //获取绝对路径
        System.out.println(f.getAbsoluteFile());
        //获取file对象的修饰过的绝对路径
        System.out.println(f.getCanonicalPath());

    }
}


